package com.srcptit.tranning.toannt.btvn1;
import java.util.Scanner;
public class Lietke {
public static void main(String[]args){
	Scanner sc=new Scanner(System.in);
	System.out.println("nhap vao n: ");
	int n=sc.nextInt();
	System.out.println(n+" so nguyen to dau tien la:");
	dayso(n);
}
public static void dayso(int n){
	int dem=0;
	long i=1;
	while(true){
		if(dem==n)break;
		else
			if(test(i)){
				System.out.print(i+"	");
				dem++;
				
			}
		i++;
	}
	
}
public static boolean test(long n){
	   if(n < 2) return false;
       for( int i = 2; i <= Math.sqrt(n); i++){
           if( n % i == 0) return false;
       }
       return true;
}
}
